package com.erp.remote.purchase;

import com.erp.entity.purchase.PurchaseOrderDetail;
import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author :qinya
 * @PackageName:com.erp.remote.purchase
 * @ClassName: PurchaseOrder
 * @Description: TODO
 * @date : 2025/7/7,21:21
 */
@RequestMapping("/order")
public interface PurchaseOrderRemote {

    /**
     * 给仓库的接口，查询所有的已审核通过的购货单+详情
     */
    @GetMapping("/findPurchaseOrderByCompanyId")
    AjaxResult findPurchaseOrderByCompanyId(@RequestParam("companyId") Integer companyId);

    /**
     * 根据id查询采购单详情
     */
    @GetMapping("/findPurchaseOrderById")
    AjaxResult selectPurchaseOrderById(@RequestParam("purchaseOrderId") Integer purchaseOrderId, @RequestParam("companyId") Integer companyId);

    /**
     * 批量修改根据购货单详情id修改购货单商品未入库数量
     */
    @PostMapping("/batchEditById")
    AjaxResult batchUpdatePurchaseOrderDetailById(@RequestBody List<PurchaseOrderDetail> purchaseOrderDetailList);


    /**
     * 根据购货单详情id修改购货单商品未入库数量
     *
     * @param
     * @return
     */
    @PostMapping("/editState")
    AjaxResult editPurchaseOrderState(@RequestBody Map<String, Object> params);

    @PostMapping("/checkGoodsByCode")
    AjaxResult checkGoodsByCode(@RequestBody List<String> goodsCodeList, @RequestParam("companyId") Integer companyId);

    /**
     * 根据公司id查询购货单数量
     *
     * @param companyId
     * @return
     */
    @GetMapping("/count")
    Integer selectPurchaseOrderCount(@RequestParam("companyId") Integer companyId);

}
